#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <iostream>

using namespace std;

void *newthreadrun(void *args)
{

    while (1)
    {
        cout << "I am new pthread" << endl;
        sleep(1);
    }
    
}

int main()
{
    pthread_t tid;
    pthread_create(&tid, nullptr, newthreadrun, nullptr);

    while (1)
    {
        cout << "I am main pthread" << endl;
        sleep(1);
    }
    return 0;
}